package com.demo.logistics;

import com.demo.logistics.R;
import com.demo.logistics.stockControl.ui.NewProductView;
import com.demo.logistics.stockControl.ui.ProductListView;
import com.demo.logistics.stockControl.ui.StockListView;
import com.demo.logistics.stockControl.ui.StockReceiveView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class LogisticsMain extends Activity {
	
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        bindStockReceivingBtnEvent();
        bindStockListBtnEvent();
        bindNewProductBtnEvent();
        bindProductListBtnEvent();
    }
    
    public void bindStockReceivingBtnEvent(){
    	Button btn = (Button)findViewById(R.id.btn_new_stock_receiving);
    	btn.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity(new Intent(getApplicationContext(), StockReceiveView.class));
			}
		});
    }
    
    public void bindStockListBtnEvent(){
    	Button btn = (Button)findViewById(R.id.btn_view_stock_list);
    	btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(getApplicationContext(), StockListView.class));
			}
		});
    }
    
    public void bindNewProductBtnEvent(){
    	Button btn = (Button)findViewById(R.id.btn_new_product);
    	btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(getApplicationContext(), NewProductView.class));
			}
		});
    }
    
    public void bindProductListBtnEvent(){
    	Button btn = (Button)findViewById(R.id.btn_view_product_list);
    	btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(getApplicationContext(), ProductListView.class));
			}
		});
    }
    
    @Override
    public void onStop(){
    	super.onStop();
    }
}